<template>
  <BasicModal
    v-bind="$attrs"
    @register="register"
    title="添加新的服务器配置"
    @ok="choose"
    width="400px"
    :minHeight="100"
    :body-style="{ marginLeft: '10px', marginRight: '10px' }"
  >
    <span class="text-sm mr-8px">服务器类型:</span>
    <Select v-model:value="serverType">
      <SelectOption value="LwM2MServer">LwM2M Server</SelectOption>
      <SelectOption value="BootstrapServer">Bootstrap Server</SelectOption>
    </Select>
  </BasicModal>
</template>

<script lang="ts" setup>
  import { Select, SelectOption } from 'ant-design-vue';
  import { ref } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  const serverType = ref<string>('LwM2MServer');
  const emit = defineEmits(['choose-type']);
  const [register, { closeModal }] = useModalInner();
  function choose() {
    emit('choose-type', serverType.value);
    closeModal();
  }
</script>
